The user can install an error handler function, that will execute if a
fatal error occurs in an application or inside of the @CHIP-RTOS.
The callback function must have the following form:
void huge _pascal Err_Handler (int error_code)
The error_code
input parameter can have the following values:
1: Invalid opcode (usually caused by corrupted memory).
The current task will be suspended.
2: Fatal kernel error (usually caused by corrupted memory
or a task stack overflow)
3: Fatal internal TCPIP error, calling task is supended
4: TCPIP stack reaches memory limit
5: TCPIP memory allocation error
6: Ethernet bus error (hardware defect)
7: Ethernet link error(SC13 only, cable not connected?)
8: Flash write error -> Flash defect (IPC@CHIP® is no longer usable)
9: Low Memory error -> called if an alloc (system or user) failed
10: RTOS memory list corrupted
Error codes in the range[1000..9999] are reserved for Beck drivers
or libraries. Currently the following codes are used:
1000: GCLIB - The communication between the IPC@CHIP® and the
graphics controller failed.
Error codes starting from 10000 can be used by user applications.
In all cases (except error code 7 and 9, driver/library and application
codes depend) we recommend to reboot the IPC@CHIP® (see below).
If the flash device has a defect, the IPC@CHIP® is no longer usable
Important:
Do not use any message printing inside your error handler
if errorcode is 3 or 4 and telnet is part of your stdio. In this case
your exit handler would hang inside of the print call.